﻿@import (less) '../node_modules/@fontsource/open-sans/latin.css';
@import (less) '../node_modules/@fontsource/roboto-condensed/latin.css';
@import (inline) '../node_modules/normalize.css/normalize.css';

@import 'imports/common.less';
@import 'imports/forms.less';

:root {
    --background-color: #fff;
    --header-separator-color: #fff;
    --error-header-color: @error-color;
    --warning-header-color: @warning-color;
    --muted-header-color: #bbb;
    --content-loader-color: @primary-color;

    --disclaimer-padding: 2px 4px;
}

* {
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: 'Open Sans', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    background-color: var(--background-color);

    &.loading {
        visibility: hidden;
    }
}

#app {
    display: contents;
}

p {
    margin-bottom: 0;
    margin-top: 0;
}

p + p {
    margin-top: 1em;
}

a {
    color: #2e8bcc;
    text-decoration: none;
    cursor: pointer;

    &:hover {
        text-decoration: underline;
    }
}

ul, ol {
    margin: 0;
    padding: 0;
}

li {
    list-style-type: none;
}

code {
    .code-text();
}

main {
    display: flex;
    flex: 1 0 0;

    > * {
        flex: 1 0 50%;
        width: 0;
    }
}

header, footer {
    flex: 0 0 auto;
}

header .spacer {
    visibility: hidden;
    width: 1px;
}

.top-section-group {
    display: flex;
    flex-direction: column;
    position: relative;
}

.block-section,
.top-section {
    display: flex;
    flex-direction: column;

    > header {
        .header();
        position: relative;
        display: flex;
        align-items: center;

        > h1 {
            display: inline-block;
            margin-top: auto;
            margin-bottom: auto;

            font-size: 100%;
            font-weight: normal;
        }
    }

    .content {
        position: relative;
        flex: 1 0 auto;
    }
}

.top-section-group-results {
    > section > header {
        border-left: 1px solid var(--header-separator-color);
    }

    .content {
        border-left: 1px solid var(--border-color);
    }
}

.content .loader {
    position: absolute;
    z-index: 1000;
    top: 10px;
    right: 10px;
    font-size: 25px;
    color: var(--content-loader-color);
}

header {
    .option-language {
        display: inline-block;
    }

    .option-language, .option-target {
        margin-left: @header-block-margin;
        margin-right: @header-block-margin;
    }

    .option-branch, .option-optimizations {
        margin-left: auto;
    }
}

.option-branch select {
    max-width: 15em;
}

.loading .content > :not(.loader) {
    opacity: 0.5;
}

.code, .result {
    flex-shrink: 0;
    flex-grow: 1;
}

section.details-only {
    header {
        background-color: var(--muted-header-color);
    }

    .content {
        font-size: 90%;
        overflow: auto;
    }
}

.branch-details,
.warnings,
.root-status-default .errors {
    flex-shrink: 0;
    max-height: 200px;

    .content {
        flex-shrink: 1;
    }
}

.errors header {
    background-color: var(--error-header-color);
}

.warnings header {
    background-color: var(--warning-header-color);
}

.root-status-error {
    .code header,
    .result header {
        background-color: var(--error-header-color);
    }

    .result {
        flex: 0 1 auto;
        .content {
            display: none;
        }
    }

    .errors {
        flex: 1 1 auto;
        header {
            display: none;
        }
        .content {
            flex-basis: 0;
        }
        &.collapsed .content {
            display: block;
        }
    }

    .warnings {
        display: none;
    }

    .loader {
        color: @error-color;
    }
}

.diagnostic {
    white-space: pre-wrap;
}

.errors, .warnings {
    .content {
        .code-text();
        overflow: auto;
    }

    li {
        padding: 5px 10px;
    }
}

.result-content {
    --result-container-padding: 4px;
    padding: var(--result-container-padding);
}

.result-cached-indicator {
    cursor: help;
    color: var(--header-text-color);
    opacity: 0.6;
}

.disclaimer,
.message-positive {
    display: block;
    width: 100%;
    padding: var(--disclaimer-padding);

    a {
        color: inherit;
        text-decoration: underline;
    }

    p + p {
        margin-top: 4px;
    }
}

.disclaimer {
    background-color: @disclaimer-color;
}

.message-positive {
    color: @message-positive-color;
}

.fragment {
    display: contents;
}

.block-with-label {
    display: flex;
    align-items: center;

    label {
        white-space: nowrap;
    }
}

@import 'imports/footer.less';
@import 'imports/loader.less';
@import 'imports/expanders.less';
@import 'imports/markdown.less';
@import 'imports/branches.less';
@import 'imports/ast.less';
@import 'imports/explanations.less';
@import 'imports/codemirror.less';
@import 'imports/output.less';
@import 'imports/modals.less';
@import 'imports/github.less';
@import 'imports/offline.less';
@import 'imports/dark.less';
@import 'imports/mobile.less';